<?php


namespace app\model;


use think\Model;

class Members extends Model
{
//用户表关联喂养记录

    public function Milk(){
        //关联喂养记录，根据用户ID来查询

            //用户模型中添加方法，关联喂养模型/类，喂养模型中关联的ID/外键，用户模型中主键
            return $this->hasMany(Milk::class,'user_id','id');

    }
}